import Article from "@/views/Article.vue";
import Collect from "@/views/Collect.vue";
import Layout from "@/views/Layout.vue";
import ArtucleDetail from "@/views/ArticleDetail.vue";
import User from "@/views/User.vue";
import Like from "@/views/Like.vue";
import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const router = new VueRouter({
    routes: [
        { path: '/', redirect: '/article' },
        {
            path: '/', component: Layout,
            //嵌套
            children: [
                { path: '/article', component: Article },
                { path: '/collect', component: Collect },
                { path: '/like', component: Like },
                { path: '/user', component: User },
            ]
        },
        { path: '/detail', component: ArtucleDetail },

    ]
});

export default router;